package com.cai.primeton.repository;

import com.cai.primeton.entity.PBook;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @version 1.0
 * @author：蔡松坡
 * @date：2021/7/1 15 : 52
 * @package：com.cai.primeton.repository
 */
public interface BookRepo extends JpaRepository<PBook,Integer> {

    @Query("select number,name,author,press from pbook where type = :t")
    List<PBook> findALlBooks(@Param("t") Integer t);

    List<PBook> findAllByType(@Param("t") Integer t);


}
